-
Notifications
You must be signed in to change notification settings - Fork 552
Cleanup conversion webhooks when an operator is uninstalled #2832
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cleanup conversion webhooks when an operator is uninstalled #2832
Conversation
Feel free to take a look @amisevsk. |
7f73edf
to
f50aed1
Compare
Needs an e2e test |
ab76e50
to
daa6b8b
Compare
I've added the e2e test. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: awgreene, dinhxuanvu The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Problem: When uninstalling a CSV, OLM has always avoided deleting the associated CRD as all CRs on cluster are subsequently deleted, possibly resulting in user dataloss. OLM supports defining conversion webhooks within the CSV. On cluster, conversion webhooks are defined with a CRD and point to a service that handles conversion. If the service is unable to fulfill the request, all requests against the CRs associated with the CRD will fail. When uninstalling a CSV, OLM does not remove the conversion webhook from the CRD, meaning that all requests against the CRs associated with the CRD will fail, resulting in at least two concerns: 1. OLM is unable to subsequently reinstall the operator. When installing a CSV, if the CRD already exists and instances of CRs exist as well, OLM performs a series of checks which ensure that none of the CRs are invalidated against the new schema. The existing CRD's conversion webhooks points to a non-existant service, causing the check to fail and preventing installs. 2. Broken conversion webhooks causes kubernete's garbage collection to fail. Solution: When a CSV is deleted, if no CSV exists that is replacing it, set the CRD's conversion strategy to None. Signed-off-by: Alexander Greene <[email protected]>
daa6b8b
to
1e08b53
Compare
/lgtm |
@awgreene: cannot checkout In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Addresses #2830
Problem: When uninstalling a CSV, OLM has always avoided deleting the
associated CRD as all CRs on cluster are subsequently deleted, possibly
resulting in user dataloss.
OLM supports defining conversion webhooks within the CSV. On cluster,
conversion webhooks are defined within a CRD and point to a service that
handles conversion. If the service is unable to fulfill the request,
all requests against the CRs associated with the CRD will fail.
When uninstalling a CSV, OLM does not remove the conversion webhook from
the CRD, meaning that all requests against the CRs associated with the
CRD will fail, resulting in at least two concerns:
a CSV, if the CRD already exists and instances of CRs exist as well,
OLM performs a series of checks which ensure that none of the CRs are
invalidated against the new schema. The existing CRD's conversion
webhooks points to a non-existant service, causing the check to fail
and preventing installs.
fail.
Solution: When a CSV is deleted, if no CSV exists that is replacing it,
set the CRD's conversion strategy to None.